import request from '@/utils/request'

/**
 * trade-index
 * @param {*} data
 * @returns
 */
export function tradeIndex(data) {
  return request({
    url: '/api/trade/index',
    method: 'post',
    data
  })
}

/**
 * Trend Chart
 * @param {Object} data
 */
export function getTrendChart(data) {
	return request({
		url: '/api/trade/getTrendChart',
		method: 'post',
		data
	})
}

/**
 * unSettlement
 * @param {Object} data
 */
export function unSettlement(data) {
	return request({
		url: '/api/trade/order/unSettlement',
		method: 'post',
		data
	})
}

/**
 * cancel order
 * @param {Object} data
 */
export function cancelOrder(data) {
	return request({
		url: '/api/trade/order/cancel',
		method: 'post',
		data
	})
}

/**
 * Transaction History 
 * @param {Object} data
 */
export function orderHistory(data) {
	return request({
		url: '/api/trade/order/history',
		method: 'post',
		data
	})
}

/**
 * cancel List
 * @param {Object} data
 */
export function orderCancelList(data) {
	return request({
		url: '/api/trade/order/cancelList',
		method: 'post',
		data
	})
}

/**
 * Enter the purchase page
 * @param {Object} data
 */
export function tradeBuy(data) {
	return request({
		url: '/api/trade/buy',
		method: 'post',
		data
	})
}

/**
 * buy Submit
 * @param {Object} data
 */
export function buySubmit(data) {
	return request({
		url: '/api/trade/buySubmit',
		method: 'post',
		data
	})
}


/**
 * sell list
 * @param {Object} data
 */
export function orderSellList(data) {
	return request({
		url: '/api/trade/order/sellList',
		method: 'post',
		data
	})
}

/**
 * sell Submit
 * @param {Object} data
 */
export function sellSubmit(data) {
	return request({
		url: '/api/trade/order/sellSubmit',
		method: 'post',
		data
	})
}



export function queryMyPledgeDetailByNode(data) {
	return request({
		url: '/api/queryMyPledgeDetailByNode',
		method: 'post',
		data
	})
}

export function queryValutList(data) {
	return request({
		url: '/api/queryValutList',
		method: 'post',
		data
	})
}

export function pledge(data) {
	return request({
		url: '/api/pledge',
		method: 'post',
		data
	})
}

/**
 * Enter the purchase page
 * @param {Object} data
 */
export function tradeSell(data) {
	return request({
		url: '/api/trade/sell',
		method: 'post',
		data
	})
}